import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;

/**
 * create by Sun
 * 2018/8/23
 */
public class test {
    static Properties p=new Properties();

    public static void main(String[] args) {
        try {
            //InputStream resourceAsStream = test.class.getClassLoader().getResourceAsStream("properties.properties");

            ResourceBundle properties = ResourceBundle.getBundle("properties");
            String url1 = properties.getString("url");
            System.out.println(url1);

            String url = p.getProperty("url1");
            System.out.println(url);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
